package org.springcloud.wisdom.spring_01_canteen.login.controller;

import org.springcloud.wisdom.spring_01_canteen.login.entity.LoginRequest;
import org.springcloud.wisdom.spring_01_canteen.login.entity.LoginResponse;
import org.springcloud.wisdom.spring_01_canteen.login.service.Cloginservice;
import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;
@RestController
@CrossOrigin
@RequestMapping("/all")
public class LoginController {
    @Autowired
    private Cloginservice cloginservice;

    @PostMapping("/login")
    public LoginResponse login(@RequestBody LoginRequest loginRequest) {
        return cloginservice.login(loginRequest);
    }
}
